
import { login, logout, getInfo,getUserInfo } from '@/api/user'
import { getToken, setToken, removeToken } from '@/utils/auth'
import { resetRouter } from '@/router'
import axios from 'axios'


const getDefaultState = () => {
    return {
        token: getToken(),
        name: getToken(),
        avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
        adminInfo: {}
    }
}

const state = getDefaultState()
//   // get user info
//   getInfo({ commit, state }) {
//     return new Promise((resolve, reject) => {
//       getInfo(state.token).then(response => {
//         const { data } = response
const mutations = {


}

const actions = {

//         commit('SET_NAME', name)
//         commit('SET_AVATAR', avatar)
//         resolve(data)
//       }).catch(error => {
//         reject(error)
//       })
//     })
//   },

}

export default {
    namespaced: true,
    state,
    mutations,
    actions,
    // getters
}

